Ext.define("core.system.view.SysGrid", {
    extend: "Ext.grid.Panel",
    alias: "widget.sysGrid",
    store: "core.system.store.SysStore",
    selModel: {
        selType: "checkboxmodel"
    },
    border: 0,
    multiSelect: true,
    frame: true,
    viewConfig: {
        enableTextSelection: true//单元格内容可以被选中，便于复制
    },
    tbar: [
        {xtype: 'button',text:"双击数据修改密码",  iconCls: 'table_edit'}
    ],
    enableKeyNav: true,  //可以使用键盘控制上下
    columnLines: true, //展示竖线
    columns: [
        {xtype: 'rownumberer'},
        {text: "用户名", dataIndex: "userName", width: 100, border: 50},
        {text: "昵称", dataIndex: "nickName", width: 100, border: 50},
        {
            text: "性别", dataIndex: "gender", width: 50, renderer: function (v) {
            if (v == "1") {
                return "<font color=green>男</font>";
            } else if (v == "2") {
                return "<font color=red>女</font>";//
            } else if (v == "3") {
                return "未知";//
            }
        }
        },
        {text: "手机", dataIndex: "cellPhone", width: 100, border: 50},
        {text: "地址", dataIndex: "address", width: 250, border: 50},
        {text: "描述", dataIndex: "infoDesc", width: 200, border: 50},
        {
            text: "创建时间", dataIndex: "createTime", width: 140, border: 50,
            renderer: function (v) {
                return v.substring(0, 19);
            }
        },
        {
            text: "最后修改时间", dataIndex: "updateTime", width: 140, border: 50,
            renderer: function (v) {
                return v.substring(0, 19);
            }
        }

    ],
    initComponent: function () {
        this.callParent(arguments);
    }
});